#ifndef MEASURECORE_H
#define MEASURECORE_H

extern "C" int GetHistMinBin(const short *pBuffer, short Length);
extern "C" int GetHistMaxBin(const short *pBuffer, short Length);
extern "C" int GetHistMedianBin(const short *pBuffer, short Length, int TotalPop);
extern "C" int GetHistMaxPopBin(const short *pBuffer, short Length, int *pMaxPop);
extern "C" int GetHistMeanBin(const short *pBuffer, short Length);
extern "C" int GetHistSquareSigmaBin(const short *pBuffer, short Length, int Mean);
extern "C" int GetHistSquareRMSBin(const short *pBuffer, short Length);
extern "C" int GetHistArea(const short *pBuffer, short Length);
extern "C" int GetHistTotalPop(const short *pBuffer, short Length);
extern "C" int GetHistMeanPop(const short *pBuffer, short Length);
extern "C" int GetHistPeakNum(const short *pBuffer, short Length, int MeanPop, int Range, int OverMidNum, int PeakCenter[], int PeakWidth[]);

extern "C" long GetHistSumBin(const short *pBuffer, short Length);
extern "C" long GetHistSquareSumBin(const short *pBuffer, short Length);

extern "C" int FindFirstMid(short *pBuffer, int Length, const int yBaseMidTop[]);
extern "C" int FindFirstOrient(short *pBuffer, short xFirstMid, int Length, const int yBaseMidTop[]);
extern "C" int FindLastMid(short *pBuffer, int Length, const int yBaseMidTop[]);
extern "C" int FindLastOrient(short *pBuffer, short xLastMid, int Length, const int yBaseMidTop[]);
extern "C" void Find1stRising(short *pBuffer, int Length, const int yBaseMidTop[], int xBaseMidTop[]);
extern "C" void Find1stFalling(short *pBuffer, int Length, const int yBaseMidTop[], int xBaseMidTop[]);
extern "C" int Find3rdEdgeMid(short *pBuffer, int Length, short Orient, const int x1stRisingTop, const int x1stFallingBase, const int yMid);
extern "C" void FindPNWidthFromRising(short *pBuffer, short xFirstMid, int Length, const int yBaseMidTop[], int xPNWidthSum[], int PNWidthCnt[]);
extern "C" void FindPNWidthFromFalling(short *pBuffer, short xFirstMid, int Length, const int yBaseMidTop[], int xPNWidthSum[], int PNWidthCnt[]);
extern "C" void Find1stRisingMaxMin(short *pBuffer, int Length, int yMid, const int xBaseMidTop[], int yEdgeMaxMin[]);
extern "C" void Find1stFallingMaxMin(short *pBuffer, int Length, int yMid, const int xBaseMidTop[], int yEdgeMaxMin[]);

#endif
